# header-only library
kmpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}

kmpkg_from_gitee(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO kumo-hub/jsoncons
    REF v${VERSION}
    SHA512 6fcd5e50da563871aa53184b92ea70f2058448554dc506b2da1daa09ae776d4944c77bae76e8f178e3113a33df4c133fd1dd5475ed5e389b9eaf57e914c156d1
    HEAD_REF master
)

kmpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}"
    OPTIONS
        -DJSONCONS_BUILD_TESTS=OFF
)

kmpkg_cmake_install()
kmpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
kmpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")

kmpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
